<template>
 <view class="group" @tap="toDetail">
     <view class="group-top">
          <view class="orderNo">订单号 {{d.orderid || d.meiyeorderOrderid}}</view>
          <view :class="status">{{status[d.cardstatel+'' || d.meiyecardState+'']}}</view>
     </view>
     <view class="flex">
        <image :src="d.cardtupian || d.cardCarPhoto" mode="aspectFill"/>
        <view class="info">
               <view class="p">￥{{d.getCardprice || d.cardCurrentprice }}</view>
            <view class="t">
                {{d.cardname || d.cardName}}
              
           </view>
           
            <view class="n">X {{d.ordersum || d.meiyecardSum }} </view>
        </view>  
       
       
     </view>
     <view class="bottom">
         <view>下单时间 {{d.ordertime || d.meiyecardStarttime}} </view>
         <view v-if="d.meiyecardEndtime">支付时间 {{d.meiyecardEndtime}}</view>
     </view>
      <!-- <button disabled="{{isSubmit}}" class="btn" wx:if="{{d.cardstatel == 1}}" @tap.stop="toPay({{d.orderid}})">去支付</button>    -->
</view>
      
</template>
<script>

import {  postPayOrder} from '@/request/actions';

 export default {
       
        data(){
            return{
                 status:{
                        1:'待付款',
                        2:'已取消',
                        0:'已付款'
                    },
                    isSubmit:false,
                    id:''
            }
           
        },
        props:{
            d:{
                type:Object,
                default:{}
            }
        },
        methods:{
            toDetail(){
                // 
             
                let {meiyeorderid} = this.d;
                uni.navigateTo({
                    url: `/detailPackages/pages/beautyOrderDetail/index?form=2&meiyeorderId=${meiyeorderid}`
                })

            },
            toPay(orderNo){
                    // let {APPID:appId} =getApp().globalData;
                    // let orderType = 1;

                    // let stateid = this.$parent.stateid;

                    // console.log(this.$parent)
                 
                    //  postPayOrder({orderNo,appId,orderType}).then(r2=>{

                    //           let {data:res2} = r2;
                          
                    //           if(res2.status == 200){
                    //             this.isSubmit = true;
                    //            this.$apply();
                       
                    //             uni.requestPayment({
                    //                 ...res2.data,
                    //                 complete:res3=>{
                                      
                    //                       let {errMsg,err_code,err_desc} = res3;
                                                   
                    //                                 wx.redirectTo({
                    //                                     url:`/subPackages/pages/beautyOrderList/index?orderstartid=${stateid}`,
                    //                                     complete:()=>{
                    //                                         this.$parent.onLoad();
                    //                                     }
                    //                                 })
                                             
                                                  
                                                
                                        


                    //                 }
                    //             })

                    //           }else{
                    //                wx.showToast({
                    //                 title:res2.message,
                    //                 duration:2000
                    //             })
                    //           }



                    //   }) 

            }
        }
       
 }
    
</script>

<style lang="scss">

   
</style>